﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="chat.aspx.cs" Inherits="IM_chat" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>
        <asp:Literal runat="server" ID="lblTitle"></asp:Literal></title>
    <link href="../CSS/IM.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager2" runat="server">
            <Services>
                <asp:ServiceReference Path="~/Controls/chatProg.asmx" />
            </Services>
            <Scripts>
                <asp:ScriptReference Path="~/js/jquery-1.2.6.min.js" ScriptMode="Release" />
                <asp:ScriptReference Path="~/js/jquery-timer.js" ScriptMode="Release" />
                <asp:ScriptReference Path="~/js/ChatIM.js" ScriptMode="Release" />
                <asp:ScriptReference Path="~/Controls/tiny_mce/tiny_mce.js" />
            </Scripts>
        </asp:ScriptManager>

        <script type="text/javascript">

            tinyMCE.init({

                // General options
                mode: "textareas",
                theme: "advanced",
                plugins: "emotions",
                skin: "o2k7",
                skin_variant: "silver",
                forced_root_block: false,
                force_br_newlines: false,
                force_p_newlines: false,
                // Theme options
                theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,fontselect,fontsizeselect,emotions,forecolor,backcolor",
                theme_advanced_buttons2: "",
                theme_advanced_buttons3: "",
                theme_advanced_buttons4: "",
                theme_advanced_toolbar_location: "top",
                theme_advanced_toolbar_align: "left",
                theme_advanced_resizing: false,
                submit_patch: "false",
                add_form_submit_trigger: "false",
                add_unload_trigger: "false",

                // Example content CSS (should be your site CSS)
                content_css: "../css/TinyMCEcontent.css",
                setup: function(ed) {
                    ed.onKeyUp.add(function(ed, e) {
                        if (e.keyCode == 13) {
                            if (ed.getContent().length > 7)
                                SetMessages(ed.getContent());
                            //                        alert(ed.getContent());
                            ed.setContent("");
                        }
                        //SetMessages(ed)
                    });
                }
            });
        </script>

        <div>
            <asp:HyperLink ID="hlWhoisBuddy" runat="server"><img src="../images/imwhoisbuddy.png" /></asp:HyperLink>
            <cc1:CollapsiblePanelExtender ID="cpeWhoisBuddy" runat="server" CollapseControlID="hlWhoisBuddy"
                Collapsed="true" ExpandControlID="hlWhoisBuddy" ExpandedSize="100" TargetControlID="pnlWhoisBuddy">
            </cc1:CollapsiblePanelExtender>
        </div>
        <asp:Panel ID="pnlWhoisBuddy" runat="server">
            <div class="divProfile" id="ltProfile" runat="server">
            </div>
        </asp:Panel>
        <div class="divChatBox">
            <div>
                <asp:Image ID="imgBuddyIcon" CssClass="divBuddyIcon" runat="server" Height="50px" /></div>
            <div class="divChatBoxHistory" id="divChatHistory" runat="server">
            </div>
        </div>
        <div>
            <textarea id="elm1" name="elm1" runat="server" style="width: 100%;">
	</textarea>
            <div class="divoneMinuteWarning">
                it could take up to 1 minute for the user to see the first message sent.</div>
        </div>
    </div>
    <asp:HiddenField ID="hfRecipient" runat="server" />
    <asp:HiddenField ID="hfSender" runat="server" />
    <input id="tbChatID" style="display: none;" type="text" />
    <script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-6812912-1");
pageTracker._trackPageview();
} catch(err) {}</script>
    </form>
</body>
</html>
